<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Giveda® Embedded Midware: API/example/hello_world.cpp 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Giveda® Embedded Midware
   &#160;<span id="projectnumber">1.2.0</span>
   </div>
   <div id="projectbrief">本文档受《版权法》、《版权公约》保护。深圳技达®版权所有</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="namespaces.html"><span>命名空间</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>命名空间</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>枚举</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>枚举值</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>友元</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>宏定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>页</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_19ea4dbfe8f0e4681f60b9b97f7b5d11.html">API</a></li><li class="navelem"><a class="el" href="dir_54a45bff04d594a507c22b3bfeedac00.html">example</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">hello_world.cpp 文件参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>作为入门，我们来看一个简单的“对话框”示例。<br/>
对话框在英文中往往被叫做Dialog、MessageBox、又或者MsgBox。 示例代码如下：<br/>
 
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &lt;<a class="el" href="g_u_i_evt_loop_8h.html">gUIEvtLoop.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="g_ctrl_msg_box_8h.html">gCtrlMsgBox.h</a>&gt;</code><br/>
<code>#include &quot;gImgApp.h&quot;</code><br/>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a78a394181a2ec486cda247b5ab57ed40"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hello__world_8cpp.html#a78a394181a2ec486cda247b5ab57ed40">main</a> (int argc, char **)</td></tr>
<tr class="separator:a78a394181a2ec486cda247b5ab57ed40"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>作为入门，我们来看一个简单的“对话框”示例。<br/>
对话框在英文中往往被叫做Dialog、MessageBox、又或者MsgBox。 示例代码如下：<br/>
</p>
<pre></pre><pre>#include &lt;<a class="el" href="g_u_i_evt_loop_8h.html" title="GUIEvtLoop 为GUI程序提供了一个事件循环。 ">gUIEvtLoop.h</a>&gt;
#include &lt;<a class="el" href="g_ctrl_msg_box_8h.html" title="GCtrlMsgBox 对话框。 ">gCtrlMsgBox.h</a>&gt;</pre><pre>int main ( int argc, char** argv )
{
   <a class="el" href="class_g_u_i_evt_loop.html" title="通常情况下，GUI程序都是由事件驱动的、需要有一个事件循环。 GUIEvtLoop 为GUI程序提供了一个事件循环。 GUIEvtLoop 管理着GUI程序的执行流程、负责GUI程序在总体上、全局上的基...">GUIEvtLoop</a> a ( argc, argv );//定义UI的事件循环</pre><pre>   //定义一个对话框，该对话框有“确定”、“取消”两个按钮
   <a class="el" href="class_g_ctrl_msg_box.html" title="对话框 ">GCtrlMsgBox</a> box ( <a class="el" href="class_g_string.html" title="GString 字符串操作。对字符串进行各种运算处理。 ">GString</a> ( "提示框" ), <a class="el" href="class_g_string.html" title="GString 字符串操作。对字符串进行各种运算处理。 ">GString</a> ( "是否进入演示demo？" ), 2, NULL, "begin msgBox" );
   box.setBtnCaption ( <a class="el" href="class_g_ctrl_msg_box.html#a8dcbaa848c2f8bec8c964d08b3962cc5a0e10b4fea34ac0a465a939e3410d7ccf" title="确定按钮，值为0 ">GCtrlMsgBox::Btn_Ok</a>, <a class="el" href="class_g_string.html" title="GString 字符串操作。对字符串进行各种运算处理。 ">GString</a> ( "确定" ) );
   box.setBtnCaption ( <a class="el" href="class_g_ctrl_msg_box.html#a8dcbaa848c2f8bec8c964d08b3962cc5a99752f22b6dca9790f82f2b72352c36d" title="取消按钮，值为1 ">GCtrlMsgBox::Btn_Cancel</a>, <a class="el" href="class_g_string.html" title="GString 字符串操作。对字符串进行各种运算处理。 ">GString</a> ( "取消" ) );</pre><pre>   //显示上述对话框
   switch ( box.exec() )
   {
   case <a class="el" href="class_g_ctrl_msg_box.html#a8dcbaa848c2f8bec8c964d08b3962cc5a0e10b4fea34ac0a465a939e3410d7ccf" title="确定按钮，值为0 ">GCtrlMsgBox::Btn_Ok</a>:
       //“确定按钮”被点击
       ZL_DEBUG ( "ok has been clicked\n" );
       break;
   case <a class="el" href="class_g_ctrl_msg_box.html#a8dcbaa848c2f8bec8c964d08b3962cc5a99752f22b6dca9790f82f2b72352c36d" title="取消按钮，值为1 ">GCtrlMsgBox::Btn_Cancel</a>:
        //“取消按钮”被点击
       ZL_DEBUG ( "cancel has been clicked\n" );
       return -1;
       break;
   default:
       break;
   }</pre><pre>   return 0;
}</pre><pre>在包含远程显示功能的情况下，上述demo的硬件资源消耗情况如下：共计占用180KB flash ROM、和310KB RAM（为了开发方便，包含了140KB的堆栈大小）。
上述代码的运行效果如下：（可通过手机客户端APP查看效果）
</p>
<div class="image">
<img src="../hello_world_screenshot.jpg"  alt="可通过手机客户端APP查看运行效果"/>
</div>

</pre> </div><h2 class="groupheader">函数说明</h2>
<a class="anchor" id="a78a394181a2ec486cda247b5ab57ed40"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2019年 三月 23日 星期六 14:13:09 , 为 Giveda® Embedded Midware使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
